;Assembler header file for OSGBPB
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:01:38 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

        [       :LNOT: :DEF: OSGBPB_Hdr
        GBLS    OSGBPB_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
OSGBPB_PrivilegeOwner           *       &0
OSGBPB_PrivilegePublic          *       &FF
OSGBPB_NoMore                   *       -1

;Symbols for structure offsets and sizes
                                ^       0
OSGBPB_Name_count               #       Byte
OSGBPB_Name_c                   #       Char
OSGBPB_Name                     *       @
        
        MACRO
$label                          OSGBPB_Name_MEMBERS
$label._count                   #       Byte
        MEND
        
                                ^       0
OSGBPB_NameBase                 OSGBPB_Name_MEMBERS
OSGBPB_NameBase                 *       @

                                ^       0
OSGBPB_DiscName_name            #       OSGBPB_Name
OSGBPB_DiscName                 *       @

                                ^       0
OSGBPB_DirName_reserved         #       Byte
OSGBPB_DirName_name             #       OSGBPB_Name
OSGBPB_DirName                  *       @

                                ^       0
OSGBPB_NameList_names           #       OSGBPB_Name
OSGBPB_NameList                 *       @

                                ^       0
OSGBPB_Info_load_addr           #       Bits
OSGBPB_Info_exec_addr           #       Bits
OSGBPB_Info_size                #       Int
OSGBPB_Info_attr                #       FileSwitch_Attr
OSGBPB_Info_obj_type            #       FileSwitch_ObjectType
OSGBPB_Info_name                #       Char
OSGBPB_Info                     *       @
        
        MACRO
$label                          OSGBPB_Info_MEMBERS
$label._load_addr               #       Bits
$label._exec_addr               #       Bits
$label._size                    #       Int
$label._attr                    #       FileSwitch_Attr
$label._obj_type                #       FileSwitch_ObjectType
        MEND
        
                                ^       0
OSGBPB_InfoBase                 OSGBPB_Info_MEMBERS
OSGBPB_InfoBase                 *       @

                                ^       0
OSGBPB_SystemInfo_load_addr     #       Bits
OSGBPB_SystemInfo_exec_addr     #       Bits
OSGBPB_SystemInfo_size          #       Int
OSGBPB_SystemInfo_attr          #       FileSwitch_Attr
OSGBPB_SystemInfo_obj_type      #       FileSwitch_ObjectType
OSGBPB_SystemInfo_sin           #       Int
OSGBPB_SystemInfo_stamp         #       OS_DateAndTime
OSGBPB_SystemInfo_name          #       Char
OSGBPB_SystemInfo               *       @
        
        MACRO
$label                          OSGBPB_SystemInfo_MEMBERS
$label._load_addr               #       Bits
$label._exec_addr               #       Bits
$label._size                    #       Int
$label._attr                    #       FileSwitch_Attr
$label._obj_type                #       FileSwitch_ObjectType
$label._sin                     #       Int
$label._stamp                   #       OS_DateAndTime
        MEND
        
                                ^       0
OSGBPB_SystemInfoBase           OSGBPB_SystemInfo_MEMBERS
OSGBPB_SystemInfoBase           *       @

                                ^       0
OSGBPB_InfoStamped_load_addr    #       Bits
OSGBPB_InfoStamped_exec_addr    #       Bits
OSGBPB_InfoStamped_size         #       Int
OSGBPB_InfoStamped_attr         #       FileSwitch_Attr
OSGBPB_InfoStamped_obj_type     #       FileSwitch_ObjectType
OSGBPB_InfoStamped_file_type    #       Bits
OSGBPB_InfoStamped_name         #       Char
OSGBPB_InfoStamped              *       @
        
        MACRO
$label                          OSGBPB_InfoStamped_MEMBERS
$label._load_addr               #       Bits
$label._exec_addr               #       Bits
$label._size                    #       Int
$label._attr                    #       FileSwitch_Attr
$label._obj_type                #       FileSwitch_ObjectType
$label._file_type               #       Bits
        MEND
        
                                ^       0
OSGBPB_InfoStampedBase          OSGBPB_InfoStamped_MEMBERS
OSGBPB_InfoStampedBase          *       @

                                ^       0
OSGBPB_StringList_names         #       Skip
OSGBPB_StringList               *       @

                                ^       0
OSGBPB_InfoList_info            #       OSGBPB_Info
OSGBPB_InfoList                 *       @

                                ^       0
OSGBPB_SystemInfoList_info      #       OSGBPB_SystemInfo
OSGBPB_SystemInfoList           *       @

                                ^       0
OSGBPB_InfoStampedList_info     #       OSGBPB_InfoStamped
OSGBPB_InfoStampedList          *       @

                                ^       0
                                #       Byte
OSGBPB_Privilege                *       @


;Symbols for SWI's and SWI reason codes
XOS_GBPB                        *       &2000C
OS_GBPB                         *       &C

OSGBPB_WriteAt                  *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = file (OS_F)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_WriteAtW                 *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = file (OS_FW)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_Write                    *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = file (OS_F)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_WriteW                   *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = file (OS_FW)
   ;  R2 -> data (data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unwritten (Int)
   ;  R4 corrupted

OSGBPB_ReadAt                   *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = file (OS_F)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_ReadAtW                  *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = file (OS_FW)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;  R4 = ptr (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_Read                     *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = file (OS_F)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_ReadW                    *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = file (OS_FW)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)
   ;Exit
   ;  R2 corrupted
   ;  R3 = unread (Int)
   ;  R4 corrupted

OSGBPB_ReadDiscName             *       &5
   ;Entry
   ;  R0 = &5
   ;  R2 = disc_name (pointer to OSGBPB_DiscName)

OSGBPB_ReadCSDName              *       &6
   ;Entry
   ;  R0 = &6
   ;  R2 = csd_name (pointer to OSGBPB_DirName)

OSGBPB_ReadLibName              *       &7
   ;Entry
   ;  R0 = &7
   ;  R2 = lib_name (pointer to OSGBPB_DirName)

OSGBPB_CSDEntries               *       &8
   ;Entry
   ;  R0 = &8
   ;  R2 = name_list (pointer to OSGBPB_NameList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;Exit
   ;  R3 = unread (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntries               *       &9
   ;Entry
   ;  R0 = &9
   ;  R1 -> dir_name (String)
   ;  R2 = name_list (pointer to OSGBPB_StringList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntriesInfo           *       &A
   ;Entry
   ;  R0 = &A
   ;  R1 -> dir_name (String)
   ;  R2 = info_list (pointer to OSGBPB_InfoList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntriesSystemInfo     *       &B
   ;Entry
   ;  R0 = &B
   ;  R1 -> dir_name (String)
   ;  R2 = info_list (pointer to OSGBPB_SystemInfoList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

OSGBPB_DirEntriesInfoStamped    *       &C
   ;Entry
   ;  R0 = &C
   ;  R1 -> dir_name (String)
   ;  R2 = info_list (pointer to OSGBPB_InfoStampedList)
   ;  R3 = count (Int)
   ;  R4 = context (Int)
   ;  R5 = size (Int)
   ;  R6 -> entries (String)
   ;Exit
   ;  R3 = read_count (Int)
   ;  R4 = context_out (Int)

GBPBV                           *       &C

        ]
        END
